﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Server.Items;
using Server.Engines.Dungeons;
using Server.Mobiles;

namespace Server.Items
{
	[Flipable(0x14EB, 0x14EC)]
	public class DungeonMap : Item
	{
		[Constructable]
		public DungeonMap()
			: base(0x14EC)
		{
			Weight = 1.0;
		}

		public DungeonMap(Serial serial)
			: base(serial)
		{
		}

		public override void OnDoubleClick(Mobile from)
		{
			PlayerMobile pFrom = (PlayerMobile)from;

			if (!IsChildOf(from.Backpack))
			{
				from.SendMessage("La carte doit être dans votre inventaire pour l'utiliser !");
				return;
			}

			DungeonManager.RegisterDungeon(new DungeonDescription 
			{
				Area = new Rectangle2D(new Point2D(5121, 512), new Point2D(5236, 640)),
				Entrance = new Point3D(5188, 637, 0),
				Map = Map.Trammel,
				Name = "DarkHerumor's Dungeon",
				Owner = pFrom,
			});

			pFrom.MoveToWorld(new Point3D(5188, 637, 0), Map.Trammel);
		}
	}
}
